package tech.dongliang.juduocai.upload.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import tech.dongliang.baidu.ueditor.ActionEnter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Writer;

@Controller
public class UeUploadController {
    @RequestMapping("/ueuploader")
    public void upload(Writer writer, HttpServletRequest request, HttpServletResponse response) throws IOException {
        request.setCharacterEncoding("utf-8");
        String s = new ActionEnter(request, request.getServletContext().getRealPath("/")).exec();
        writer.write(s);
    }
}
